﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LiveatEdu.model
{
    public class Student : Person
    {
        private const int ENROLLMENT = 0;
        private const int NAME = 1;
        private const int LESSION = 2;
        private const int SAMACCOUNTNAME = 3;
        private const int PASSWORD = 4;

        public Student(List<string> studentParameter)
        {
            this.Title = studentParameter.ElementAt(ENROLLMENT);
            this.Cn = studentParameter.ElementAt(NAME);
            this.Department = studentParameter.ElementAt(LESSION);
            this.SamAccountName = studentParameter.ElementAt(SAMACCOUNTNAME);
            this.Password = this.makePassword(studentParameter.ElementAt(PASSWORD));
            this.GivenName = this.makeGivenName(this.Cn);
            this.Sn = this.Cn.Split(' ').ElementAt(this.Cn.Split(' ').Length - 1);
            this.DistinguishedName = this.makeDistinguishedName(this.SamAccountName, this.Department);
            this.Mail = this.makeMail(this.SamAccountName, this.Department);
        }


    }
}
